<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib  uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@ include file="../commons/headfiles-jquery.jsp" %>
<link href="../css/apps/contract/edit.css" rel="stylesheet" media="screen"  />
<title>添加合同</title>
<script src="${sbase }scripts/arttemp/template.js"></script>
<script type="text/javascript">
template.openTag = '<#';
template.closeTag = '#>';
var gindex = 0;
</script>
<script id="dataLine" type="text/html">
<tr>
<input type="hidden" name="bean.contractItems[<#=index#>].price" value="<#=price#>" />
<input  type="hidden"  name="bean.contractItems[<#=index#>].contractType" value="<#=contractType#>" />
  <td>
     <input class="codename" readonly="readonly" name="bean.contractItems[<#=index#>].owner.code" value="<#=code#>" />
  </td>
  <td>
     <input class="codename" readonly="readonly" name="bean.contractItems[<#=index#>].owner.name" value="<#=name#>" />
  </td> 
  <td><input  class="number-field" name="bean.contractItems[<#=index#>].validation" value="<#=validation#>" /></td> 
  <td><input  class="number-field" name="bean.contractItems[<#=index#>].storage" value="<#=storage#>" /></td> 
  <td><input  class="number-field" name="bean.contractItems[<#=index#>].remark" value="<#=remark#>" /></td> 
            
 <# for (var r=0;r<list.length;r++) { #> 
	<td>
       <input  type="hidden"  name="bean.contractItems[<#=index#>].dataItems[<#=r#>].month" value="<#=list[r].month#>" />
        <ul>
         <li><input  class="number-field" name="bean.contractItems[<#=index#>].dataItems[<#=r#>].assumpsit" value="<#=list[r].assumpsit#>" />   </li>
         <li><input  class="number-field" name="bean.contractItems[<#=index#>].dataItems[<#=r#>].custom" value="<#=list[r].custom#>"   />   </li>
        </ul>
    </td>                
 <#}#> 
  <td><a href="javascript:;" onclick="removeMe(this)"><img src="${sbase}images/removeMe.gif"/> </a></td>
</tr>
</script>
<script type="text/javascript" src="../scripts/apps/contract/edit.js"></script>
</head>
<body>
<form class="well form-inline" id="cform">
     <label>合同号: <input name="bean.name" class="input-xlarge"  />
     </label>
     <input name="bean.security" type="hidden" value="秘密" >   
     <label>客户
       <select name="bean.client.id">					
		    <c:forEach items="${clients}" var="cli">
		     <option value="${cli.id }">${cli.name }</option>
		   </c:forEach>
	    </select>
     </label>
     <label>
       合同日期
      <select name="bean.dueDate">
         <option value="2013-1-1">2013</option>
         <option value="2014-1-1">2013</option>
      </select>       
     </label>     
     <label>
     <button class="btn btn-info" type="button" onclick="saveOne()">
      <i class="icon-white icon-ok"></i>                             
                                    保存合同
     </button>
     </label>
     <table class="table table-striped table-bordered table-condensed">
        <thead>
          <tr>
            <th colspan="20">
            <button class="btn btn-success" id="itemBtn" type="button">添加数据项</button>
            </th>
          </tr>
          <tr>
          <th rowspan="2">代码</th>
          <th rowspan="2">名称</th>         
          <th rowspan="2" class="number-field">验收状态</th>
          <th rowspan="2" class="number-field">库存总量</th>
          <th rowspan="2" class="remark">约定事项</th>
          <th colspan="12">月份合同及缴库数</th>
          <th rowspan="2">管理</th>
          </tr>
          <tr>
           <th>1</th>
           <th>2</th>
           <th>3</th>
           <th>4</th>
           <th>5</th>
           <th>6</th>
           <th>7</th>
           <th>8</th>
           <th>9</th>
           <th>10</th>
           <th>11</th>
           <th>12</th>
           
          </tr>
        </thead>
        
        <tbody id="pdtBody">
         
        </tbody>
        
        <tfoot>
        </tfoot>
     </table>
</form>
</body>
</html>